import { Injectable } from '@angular/core';
import { Router, Params } from '@angular/router';
declare let $:any;

@Injectable()
export class isBindPNService{
    public isbindPublicNumber:any;
    public id: any;
    constructor(
        private router : Router
    ){
        this.id = $.cookie("id");
        this.isbindPublicNumber = $.cookie("has_mp");
    }

    isBindPN(){
        let self:any = this;
        if( self.isbindPublicNumber == 0){
            console.log("1");
            self.router.navigate(['/bind_public_number']);
        }
    }

    isId(){
        let self:any = this;
        console.log(self.id);

        if(self.id == "null" || self.id == null){
            console.log("1");
            self.router.navigate(['/login']);
        }
    }
}
